package com.lsl.factory_method.example2.method.racialtype;

import com.lsl.factory_method.example2.method.WeaponType;
import com.lsl.factory_method.example2.method.weapontype.OrcWeapon;
import com.lsl.factory_method.example2.method.weapontype.Weapon;

import java.util.Arrays;
import java.util.EnumMap;
import java.util.Map;

/**
 * 兽人族铁匠
 *
 * @author Zed
 * @description
 * @date 2023/1/8 15:00
 */
public class OrcBlacksmith implements Blacksmith {
    private static final Map<WeaponType, OrcWeapon> ORCARSENAL;

    static {
        ORCARSENAL = new EnumMap<>(WeaponType.class);
        Arrays.stream(WeaponType.values()).forEach(type -> ORCARSENAL.put(type, new OrcWeapon(type)));
    }

    @Override
    public Weapon manufactureWeapon(WeaponType weaponType) {
        return ORCARSENAL.get(weaponType);
    }

    @Override
    public String toString() {
        return "The orc blacksmith";
    }
}
